home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / eiffel / smalleif.97 / se.t / SmallEiffel / lib_test / test_read_character.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  1.0 KB  |  47 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_READ_CHARACTER
  5.  
  6. creation {ANY}
  7.    make
  8.    
  9. feature {ANY}
  10.    
  11.    i: INTEGER;
  12.    path: STRING;
  13.    sfr: STD_FILE_READ;
  14.    
  15.    make is
  16.       do
  17.      path := get_environment_variable("SmallEiffel");
  18.      path.append("/lib_test/test_read_character.e");
  19.      from  
  20.         i := 0;
  21.         !!sfr.connect_to(path);
  22.         if not sfr.is_connected then
  23.            std_output.put_string("ERROR in TEST_READ_CHARACTER.%N");
  24.         end;
  25.      until
  26.         sfr.end_of_input
  27.      loop
  28.         sfr.read_character;
  29.         i := i + 1;
  30.      end;
  31.      if i - 1 = size then
  32.      else
  33.         std_output.put_string("ERROR in TEST_READ_CHARACTER.%N");
  34.         std_output.put_string("File %"");
  35.         std_output.put_string(path);
  36.         std_output.put_string("%" has changed%Nor it is a bug (");
  37.         std_output.put_integer(size);
  38.         std_output.put_string(" /= ");
  39.         std_output.put_integer(i);
  40.         std_output.put_string(")%N.");
  41.      end;
  42.       end;
  43.    
  44.    size: INTEGER is 1072;
  45.   
  46. end -- TEST_READ_CHARACTER
  47.